/*
 * @description  : 品规的类型对应的物品性质分类对象
 * @descriptionDetail: 品规的类型对应的物品性质分类对象
 * @copyright    : 浙江烟草
 * @author       : mhb
 * @create       : 2023-02-02 15:14:31
 */

import {GOODS_PROP_SUBTYPE,PRODUCT_TYPE,} from "./enum.js";

// 物品性质 - 枚举对象
let goodsNature = GOODS_PROP_SUBTYPE;

// 品规分类对应的物品性质
let propSubtypeMap = {
  // 卷烟
  cigarette: [
    { title: goodsNature['DOMESTIC_CIGAR_CN'], id: goodsNature['DOMESTIC_CIGAR'], },
    { title: goodsNature['IMPORTED_CIGAR_CN'], id: goodsNature['IMPORTED_CIGAR'], },
    { title: goodsNature['FAKE_DOMESTIC_CIGAR_CN'], id: goodsNature['FAKE_DOMESTIC_CIGAR'], },
    { title: goodsNature['FAKE_IMPORTED_CIGAR_CN'], id: goodsNature['FAKE_IMPORTED_CIGAR'], },
    { title: goodsNature['SMUGGLE_LEAVES_CN'], id: goodsNature['SMUGGLE_LEAVES'], },
    { title: goodsNature['EXIT_RETURN_SMOKE_CN'], id: goodsNature['EXIT_RETURN_SMOKE'], },
    { title: goodsNature['OFFSHORING_CN'], id: goodsNature['OFFSHORING'], },
    { title: goodsNature['FREE_DUTY_CIGAR_CN'], id: goodsNature['FREE_DUTY_CIGAR'], },
  ],
  // 雪茄烟
  cigar: [
    { title: goodsNature['HOMEMADE_CIGAR_CN'], id: goodsNature['HOMEMADE_CIGAR'], },
    { title: goodsNature['IMPORTED_PERFECTO_CN'], id: goodsNature['IMPORTED_PERFECTO'], },
    { title: goodsNature['FAKE_HOMEMADE_CIGAR_CN'], id: goodsNature['FAKE_HOMEMADE_CIGAR'], },
    { title: goodsNature['FAKE_FOREIGN_CIGAR_CN'], id: goodsNature['FAKE_FOREIGN_CIGAR'], },
    { title: goodsNature['SMUGGLE_FOREIGN_CIGAR_CN'], id: goodsNature['SMUGGLE_FOREIGN_CIGAR'], },
    { title: goodsNature['EXIT_RETURN_PERFECTO_CN'], id: goodsNature['EXIT_RETURN_PERFECTO'], },
    { title: goodsNature['FREE_DUTY_CIGAR_CN'], id: goodsNature['FREE_DUTY_CIGAR'], },
  ],
  // 新型卷烟
  newCigarette: [
    { title: goodsNature['HEAT_WITHOUT_TRUE_CIGAR_CN'], id: goodsNature['HEAT_WITHOUT_TRUE_CIGAR'], },
    { title: goodsNature['HEAT_WITHOUT_FAKE_CIGAR_CN'], id: goodsNature['HEAT_WITHOUT_FAKE_CIGAR'], },
    { title: goodsNature['HEAT_WITHOUT_SMUGGLE_CIGAR_CN'], id: goodsNature['HEAT_WITHOUT_SMUGGLE_CIGAR'], },
    { title: goodsNature['RETURN_SMOKE_HEAT_WITHOUT_CN'], id: goodsNature['RETURN_SMOKE_HEAT_WITHOUT'], },
    { title: goodsNature['FREE_DUTY_CIGAR_CN'], id: goodsNature['FREE_DUTY_CIGAR'], },
  ],
  // 电子烟套装
  ecigaretteSuit: [
    { title: goodsNature['ELE_DOMESTIC_KITS_CN'], id: goodsNature['ELE_DOMESTIC_KITS'], },
    { title: goodsNature['ELE_IMPORTED_KITS_CN'], id: goodsNature['ELE_IMPORTED_KITS'], },
    { title: goodsNature['ELE_FAKE_DOMESTIC_KITS_CN'], id: goodsNature['ELE_FAKE_DOMESTIC_KITS'], },
    { title: goodsNature['ELE_FAKE_IMPORTED_KITS_CN'], id: goodsNature['ELE_FAKE_IMPORTED_KITS'], },
    { title: goodsNature['ELE_SMUGGLE_KITS_CN'], id: goodsNature['ELE_SMUGGLE_KITS'], },
    { title: goodsNature['ELE_EXIT_RETURN_KITS_CN'], id: goodsNature['ELE_EXIT_RETURN_KITS'], },
    { title: goodsNature['ELE_NONE_TX_TAG_CN'], id: goodsNature['ELE_NONE_TX_TAG'], },
  ],
  // 电子烟烟具
  ecigaretteSet: [
    { title: goodsNature['ELE_DOMESTIC_SET_CN'], id: goodsNature['ELE_DOMESTIC_SET'], },
    { title: goodsNature['ELE_IMPORTED_SET_CN'], id: goodsNature['ELE_IMPORTED_SET'], },
    { title: goodsNature['ELE_FAKE_DOMESTIC_SET_CN'], id: goodsNature['ELE_FAKE_DOMESTIC_SET'], },
    { title: goodsNature['ELE_FAKE_IMPORTED_SET_CN'], id: goodsNature['ELE_FAKE_IMPORTED_SET'], },
    { title: goodsNature['ELE_SMUGGLE_SET_CN'], id: goodsNature['ELE_SMUGGLE_SET'], },
    { title: goodsNature['ELE_EXIT_RETURN_SET_CN'], id: goodsNature['ELE_EXIT_RETURN_SET'], },
    { title: goodsNature['ELE_NONE_TX_TAG_CN'], id: goodsNature['ELE_NONE_TX_TAG'], },
  ],
  // 电子烟烟弹
  ecigaretteSmokeBomb: [
    { title: goodsNature['ELE_DOMESTIC_CARTRIDGE_CN'], id: goodsNature['ELE_DOMESTIC_CARTRIDGE'], },
    { title: goodsNature['ELE_IMPORTED_CARTRIDGE_CN'], id: goodsNature['ELE_IMPORTED_CARTRIDGE'], },
    { title: goodsNature['ELE_FAKE_DOMESTIC_CARTRIDGE_CN'], id: goodsNature['ELE_FAKE_DOMESTIC_CARTRIDGE'], },
    { title: goodsNature['ELE_FAKE_IMPORTED_CARTRIDGE_CN'], id: goodsNature['ELE_FAKE_IMPORTED_CARTRIDGE'], },
    { title: goodsNature['ELE_SMUGGLE_CARTRIDGE_CN'], id: goodsNature['ELE_SMUGGLE_CARTRIDGE'], },
    { title: goodsNature['ELE_EXIT_RETURN_CARTRIDGE_CN'], id: goodsNature['ELE_EXIT_RETURN_CARTRIDGE'], },
    { title: goodsNature['ELE_NONE_TX_TAG_CN'], id: goodsNature['ELE_NONE_TX_TAG'], },
  ],
  // 电子烟（一次性）
  ecigaretteSmokeSingle:[
    { title: goodsNature['ELE_DOMESTIC_SINGLE_CN'], id: goodsNature['ELE_DOMESTIC_SINGLE'], },
    { title: goodsNature['ELE_IMPORTED_SINGLE_CN'], id: goodsNature['ELE_IMPORTED_SINGLE'], },
    { title: goodsNature['ELE_FAKE_DOMESTIC_SINGLE_CN'], id: goodsNature['ELE_FAKE_DOMESTIC_SINGLE'], },
    { title: goodsNature['ELE_FAKE_IMPORTED_SINGLE_CN'], id: goodsNature['ELE_FAKE_IMPORTED_SINGLE'], },
    { title: goodsNature['ELE_SMUGGLE_SINGLE_CN'], id: goodsNature['ELE_SMUGGLE_SINGLE'], },
    { title: goodsNature['ELE_EXIT_RETURN_SINGLE_CN'], id: goodsNature['ELE_EXIT_RETURN_SINGLE'], },
  ],
};

// 根据品规类型获取对应的物品性质分类
const getPropSubtypesByBrandSubType = function(gtype) {
  let productType = PRODUCT_TYPE;
  let pArr = [];

  switch (gtype) {
  // 卷烟
  case productType['CIGARETEE']:
    pArr = propSubtypeMap['cigarette'];
    break;
    // 雪茄烟
  case productType['CIGAR']:
    pArr = propSubtypeMap['cigar'];
    break;
    // 新型卷烟
  case productType['NEW_CIGARETEE']:
    pArr = propSubtypeMap['newCigarette'];
    break;
    // 电子烟套装
  case productType['ELECTRONIC_CIGARETEE_KITS']:
    pArr = propSubtypeMap['ecigaretteSuit'];
    break;
    // 电子烟烟具
  case productType['ELECTRONIC_CIGARETEE_SET']:
    pArr = propSubtypeMap['ecigaretteSet'];
    break;
    // 电子烟烟弹
  case productType['ELECTRONIC_CIGARETEE_CARTRIDGE']:
    pArr = propSubtypeMap['ecigaretteSmokeBomb'];
    break;
    // 电子烟(一次性)
  case productType['ELECTRONIC_CIGARETEE_SINGLE']:
    pArr = propSubtypeMap['ecigaretteSmokeSingle'];
    break;
  }
  return pArr;
};

export {
  getPropSubtypesByBrandSubType,
}